<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>03_JS数据类型</title>
</head>
<body>
<script>
    var a = 1;
    var b = 3.14;
    console.log(a, typeof a, b, typeof b);
    var c = 'hello';
    var d = "你好";
    console.log(c, typeof c, d, typeof d);
    var e = true;
    var f = false;
    console.log(e, typeof e, f, typeof f);
    var g;
    console.log(g, typeof g);
    console.log('----------------------------');
    let obj = {};
    console.log(obj, typeof obj);
    let obj2 = {name: '张三', age: 18}
    console.log(obj2, typeof obj2);
    console.log(obj2.name, obj2.age);
    obj2.like = '吃火锅';
    console.log(obj2, typeof obj2);
    console.log(obj.play);
    console.log('----------------------------');
    let arr = ['张三', 18, true, 6.6]
    console.log(arr, typeof arr);
    console.log(arr[0]);
    console.log(arr[3]);
    console.log(arr[33]);
    console.log('----------------------------');
    console.log(Boolean(0));
    console.log(Boolean(undefined));
    console.log(Boolean(null));
    console.log(Boolean(''));
    console.log(Boolean(NaN));
    console.log('----------------------------');
    console.log(Boolean(1));
    console.log(Boolean(' '));
    console.log(Boolean('hello'));
    console.log('----------------------------');
    console.log(Number(true), typeof Number(true));
    console.log(Number(false), typeof Number(false));
    console.log(Number(3));
    console.log(Number('3'), typeof Number('3'));
    console.log(Number('a'), typeof Number('a'));
</script>
</body>
</html>